package com.ase.leetcode;

import java.util.*;
import java.util.stream.Collectors;

/**
 * @author gyhstart
 * @create 2021/3/14 - 22:31
 **/
public class Test {
    public static void main(String[] args) {

        Map<String,Object> map = new HashMap<>();
        map.put("m1",1);
        map.put("m2",2);
        map.put("m3",3);
        map.put("m4",4);
        map.put("m5",5);
        Map<String,Object> map1 = new HashMap<>();
        map.put("1m1",1);
        map.put("1m2",2);
        map.put("1m3",3);
        map.put("1m4",4);
        map.put("1m5",5);

        List<Map<String,Object>> list = new ArrayList<>();
        list.add(map);
        list.add(map1);

//        for (int i = 0, length = list.size(); i < length; i++) {
//        System.out.println("list = " + list.stream().map(Integer::new).collect(Collectors.toList()));
//        }

        Map<Set<String>, Set<Map.Entry<String, Object>>> collect = list.stream().collect(Collectors.toMap(Map::keySet, Map::entrySet));
        map.forEach((key, value) -> {
            System.out.println("key: " + key + "    value: " + value);
        });
    }
}
